package com.guido.packagename;

import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;

public class activity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.main);
        //TextView myTextView = (TextView)findViewById(R.id.myTextView);
        //myTextView.setText("Modifying myTextView from code :)");
        
        CreateEverythingFromCode("Testing creating everything from code");
    }
    
    /** Called for creating basic layout with specified text */
    private void CreateEverythingFromCode(String pString)
    {
    	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
        		LayoutParams.FILL_PARENT,
        		LayoutParams.FILL_PARENT);
        
        LinearLayout.LayoutParams textViewLp = new LinearLayout.LayoutParams(
        		LayoutParams.FILL_PARENT,
        		LayoutParams.WRAP_CONTENT);
        
        LinearLayout ll = new LinearLayout(this);
        ll.setOrientation(LinearLayout.VERTICAL);
        
        TextView myTextView = new TextView(this);
        myTextView.setText(pString);
        
        ll.addView(myTextView, textViewLp);
        this.addContentView(ll, lp);
    }
}